﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharedGenomics.Domain
{
    /// <summary>
    /// Corresponds to a single result in an association job output file
    /// </summary>
    public class AssocAnalysisResult : AnalysisResult
    {
        [AnalysisResultColumn("CHR")]
        [ColumnDisplay("Chromosome", Position = -1)]
        public int Chromosome { get; private set; }

        [AnalysisResultColumn("A1")]
        public int MajorAllele { get; set; }

        [AnalysisResultColumn("A2")]
        public int MinorAllele { get; set; }

        [AnalysisResultColumn("F_A", DefaultOnParseFailed = double.NaN)]
        [ColumnDisplay("Affected", Position = 1)]
        public double ProportionAffected { get; set; }

        [AnalysisResultColumn("F_U", DefaultOnParseFailed = double.NaN)]
        [ColumnDisplay("Unaffected", Position = 2)]
        public double ProportionUnaffected { get; set; }

        [AnalysisResultColumn("L95", DefaultOnParseFailed = null)]
        [ColumnDisplay("L95", Position = 3)]
        public double? LowerConfidenceInterval { get; set; }

        [AnalysisResultColumn("U95", DefaultOnParseFailed = null)]
        [ColumnDisplay("U95", Position = 4)]
        public double? UpperConfidenceInterval { get; set; }

        [AnalysisResultColumn("OR", DefaultOnParseFailed = double.NaN)]
        [ColumnDisplay("O/R", Position = 5)]
        public double OddsRatio { get; set; }

        [AnalysisResultColumn("CHISQ", DefaultOnParseFailed = double.NaN)]
        [ColumnDisplay("Chi Squared", Position = 6, Format = "F2")]
        public double ChiSquared { get; set; }

        [AnalysisResultColumn("BONF", DefaultOnParseFailed = double.NaN)]
        [ColumnDisplay("Bonferroni", Position = 7)]
        public double Bonf { get; set; }

        //[AnalysisResultColumn("HOLM", DefaultOnParseFailed = double.NaN)]
        //public double Holm { get; set; }

        [AnalysisResultColumn("FDR_BH", DefaultOnParseFailed = double.NaN)]
        [ColumnDisplay("False Disc. Rate", Position = 8)]
        public double BonfFalseDiscoveryRate { get; set; }
    }
}
